package pages.navigator;

import pages.*;
import utils.DriverWrapper;

/**
 * Created with IntelliJ IDEA.
 * User: kvasolka
 * Date: 6/10/14
 * Time: 6:32 PM
 * To change this template use File | Settings | File Templates.
 */
public class MainNavigator {
    public static HomePage openPage (PageList page, DriverWrapper driver) throws Exception{
        switch (page) {

            case AUDIOVIDEO:
                AudioVideoPage audioVideoPage = new AudioVideoPage(driver);
                audioVideoPage.open();
                return audioVideoPage;

            case AUTO:
                AutoPage autoPage = new AutoPage(driver);
                autoPage.open();
                return autoPage;

            case AVIA:
                AviaPage  aviaPage = new AviaPage(driver);
                aviaPage.open();
                return aviaPage;

            case HOUSE:
                HousePage housePage = new HousePage(driver);
                housePage.open();
                return housePage;

            case INTERIER:
                InterierPage interierPage = new InterierPage(driver);
                interierPage.open();
                return interierPage;

            case KIDS:
                KIdsPage kIdsPage = new KIdsPage(driver);
                kIdsPage.open();
                return kIdsPage;

            case NOTEBOOKS:
                NotebooksPage notebooksPage = new NotebooksPage(driver);
                notebooksPage.open();
                return notebooksPage;

            case PHONES:
                PhonesPage phonesPage = new PhonesPage(driver);
                phonesPage.open();
                return phonesPage;

            case SHOES:
                ShoesPage shoesPage = new ShoesPage(driver);
                shoesPage.open();
                return shoesPage;

            case TOURISM:
                TourismPage tourismPage = new TourismPage(driver);
                tourismPage.open();
                return tourismPage;

            default:
                throw new Exception();

        }
    }
}